//package com.y.report.theard;
//
//import cn.hutool.core.date.SystemClock;
//import com.jd.platform.async.callback.ICallback;
//import com.jd.platform.async.callback.IWorker;
//import com.jd.platform.async.worker.WorkResult;
//import com.jd.platform.async.wrapper.WorkerWrapper;
//
//import java.util.Map;
//
///**
// * @author wuweifeng wrote on 2019-11-20.
// */
//public class ParWorker implements IWorker<String, String>, ICallback<String, String> {
//
//    @Override
//    public String action(String object, Map<String, WorkerWrapper> map) {
//        try {
//            Thread.sleep(1000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//        return String.format("result【%s】", SystemClock.now() + "---param = " + object + " thread:" + Thread.currentThread().getName());
//    }
//
//    @Override
//    public String defaultValue() {
//        return "worker1--default";
//    }
//
//    @Override
//    public void begin() {
////        System.out.println(Thread.currentThread().getName() + "- start --" + System.currentTimeMillis());
//    }
//
//    @Override
//    public void result(boolean success, String param, WorkResult<String> workResult) {
//        if (success) {
//            System.out.println("callback worker1 success--" + SystemClock.now() + "----" + workResult.getResult()
//                    + "-threadName:" + Thread.currentThread().getName());
//        } else {
//            System.err.println("callback worker1 failure--" + SystemClock.now() + "----" + workResult.getResult()
//                    + "-threadName:" + Thread.currentThread().getName());
//        }
//    }
//
//}
